cordova.define("mamp-plugin-map", function(require, exports, module) {

var exec = require('cordova/exec');

var Map = function(){};

/*
 desc:路径规划，根据JS传递的起始位置在地图上规划出一条路径
 callback:选择完成后会返回相应的index
 */
Map.prototype.Annotation = function() {
   return {
       latitude:null,
       longitude:null,
       title:null
   };
};
               
/*
 desc:路径规划，根据JS传递的起始位置在地图上规划出一条路径
 from:起点信息，Annotation对象
 to:终点信息，Annotation对象
 */
Map.prototype.pathPlanning = function(from,to) {
    exec(null,null,"Map","pathPlanning",[{"from":from,"to":to}]);
};
               
/*
 desc:地图导航，调用百度地图应用开启导航
 from:起点信息，Annotation对象
 to:终点信息，Annotation对象
 */
Map.prototype.navigation = function(from,to) {
    exec(null,null,"Map","navigation",[{"from":from,"to":to}]);
};
               
/*
 desc:地图导航，调用百度地图应用开启导航
 annotations:Annotation对象数组
 */
Map.prototype.showAnnotations = function(annotations) {
    exec(null,null,"Map","showAnnotations",[annotations]);
};
               
module.exports = new Map();
});
